package org.exteen.tag.core;

import org.exteen.ExteenException;
import org.exteen.exec.ExteenContext;
import org.exteen.exec.Tag;
import org.exteen.output.ExteenStream;
import org.exteen.parser.Attr;

public class IfTag extends Tag {

    public void doTag(ExteenContext ctx, ExteenStream stream) {
        Attr testAttr = ctx.getNode().getAttribute("test");
        if (testAttr == null) {
            throw new ExteenException("Missing test attribute in if tag");
        }
        if (Boolean.TRUE.equals(testAttr.getValue(ctx))) {
            super.doTag(ctx, stream);
        }
    }
}